<template>
	<div class="tabone">
		<div class="vinBox">
			<div class="vinSearch">
				<input type="type" name="" id="" placeholder="请在此处输入VIN码" v-model="message" maxlength="17" @keyup="upperCase" @focus="choofocus"/>
				<button class="btn_search2" @click="choose"></button>
				<span style="color:red" v-text="errors"></span>
			</div>
		</div>
		<div class="selec">
			<h3>
				<i></i>
				历史记录
			</h3>
		</div>
	</div>
</template>

<script>
	export default{
		data(){
			return{
				message:"",
				errors:""
			}
		},
		methods:{
			upperCase(){
				this.message= this.message.toUpperCase()
			},
			choose(){
				if(this.message != ""){
					let res = /^[a-zA-Z\s]{17}$/
					if(!res.test(this.message)){
						this.errors = "VIN码格式错误(长度17位)"
					}
				}
			},
			choofocus(){
				this.errors = ""
			}
		}
		
	}
</script>

<style>
</style>